Fix some crashes caused by unimplemented functions in GdkOffscreenWindow
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Fri, 8 Apr 2011 16:55:50 +0000 (01:55 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Fri, 8 Apr 2011 17:00:18 +0000 (02:00 +0900)
These crashes happen when accessing GtkWindow properties and the
GdkWindow is an offscreen (fixes https://bugzilla.gnome.org/show_bug.cgi?id=647244)

gdk/gdkoffscreenwindow.c

index 6ec5e4aec162f90f9cc4a364b9af02ae248ee659..0b8b978f37b7e8635df23ea50c17aff8c147c279 100644 (file)
@@ -684,6 +684,18 @@ gdk_offscreen_window_set_boolean (GdkWindow *window,
 {
 }
 
+static void
+gdk_offscreen_window_set_string (GdkWindow *window,
+                                const gchar *setting)
+{
+}
+
+static void
+gdk_offscreen_window_set_wmfunctions (GdkWindow            *window,
+                                     GdkWMFunction  functions)
+{
+}
+
 static void
 gdk_offscreen_window_set_transient_for (GdkWindow *window,
                                        GdkWindow *another)
@@ -740,17 +752,17 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   impl_class->set_modal_hint = NULL;
   impl_class->set_skip_taskbar_hint = gdk_offscreen_window_set_boolean;
   impl_class->set_skip_pager_hint = gdk_offscreen_window_set_boolean;
-  impl_class->set_urgency_hint = NULL;
+  impl_class->set_urgency_hint = gdk_offscreen_window_set_boolean;
   impl_class->set_geometry_hints = NULL;
-  impl_class->set_title = NULL;
-  impl_class->set_role = NULL;
-  impl_class->set_startup_id = NULL;
+  impl_class->set_title = gdk_offscreen_window_set_string;
+  impl_class->set_role = gdk_offscreen_window_set_string;
+  impl_class->set_startup_id = gdk_offscreen_window_set_string;
   impl_class->set_transient_for = gdk_offscreen_window_set_transient_for;
   impl_class->get_root_origin = NULL;
   impl_class->get_frame_extents = NULL;
   impl_class->set_override_redirect = NULL;
   impl_class->set_accept_focus = NULL;
-  impl_class->set_focus_on_map = NULL;
+  impl_class->set_focus_on_map = gdk_offscreen_window_set_boolean;
   impl_class->set_icon_list = NULL;
   impl_class->set_icon_name = NULL;
   impl_class->iconify = gdk_offscreen_window_do_nothing;
@@ -767,8 +779,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   impl_class->set_group = NULL;
   impl_class->set_decorations = NULL;
   impl_class->get_decorations = NULL;
-  impl_class->set_functions = NULL;
-  impl_class->set_functions = NULL;
+  impl_class->set_functions = gdk_offscreen_window_set_wmfunctions;
   impl_class->begin_resize_drag = NULL;
   impl_class->begin_move_drag = NULL;
   impl_class->enable_synchronized_configure = gdk_offscreen_window_do_nothing;